package com.example.attendance_back.controller;

import com.example.attendance_back.model.ResponseMessage;
import com.example.attendance_back.model.Student;
import com.example.attendance_back.service.StudentService;
import com.example.attendance_back.utils.JWTUtils;
import io.netty.util.internal.StringUtil;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/user")
public class LoginController {




    @Autowired
    private StudentService service;
    /**
     *  Spring mvc
     *     基于 web --- http协议
     *       session  --- 保存在服务器端的会话信息
     *       request  --- 来自于浏览器端的数据
     *       response --- 服务器 发给浏览器的回应
     * */

    @RequestMapping("/login")
    public ResponseMessage login(Student student){

        return service.login(student);
    }
}
